//
//  PHAsset+Ext.swift
//  
//
//  Created by bo wang on 2020/8/30.
//  Copyright © 2020 wangbo. All rights reserved.
//

import Foundation
import Photos
import CoreServices

extension PHAsset {
    var isGIF: Bool {
        let resource = PHAssetResource.assetResources(for: self).first!
        let uti = resource.uniformTypeIdentifier as CFString
        return UTTypeConformsTo(uti, kUTTypeGIF)
    }

    var filename: String {
        let resource = PHAssetResource.assetResources(for: self).first!
        return resource.originalFilename
    }
}
